package com.czd.support.service;

import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.common.Configuration;
import com.czd.support.model.FuJian;

@Service
public class FuJianService extends BaseService<FuJian> {
	
	public Paginate queryForPaginate(FuJian fuJian){
		fuJian.setPageSize(Configuration.getInstance().getDefault_page_size());
        return this.queryForPaginate(sqlId("select"), fuJian);
    }

	/**
	 * 插入附件信息
	 * @param f
	 * @return
	 */
	public boolean insert(FuJian f){
		if(this.insertAndReturnId(sqlId("insert"), f) >0){
			return true;
		}
		else{
			return false;
		}
	}
	
	/**
	 * 查找对应id的信息
	 * @param id
	 * @return
	 */
	public FuJian findById(int id) {
        return this.selectOne(sqlId("findFuJianById"),id);
    }
	
	public boolean update(FuJian fuJian) {
        return this.update(sqlId("update"),fuJian);
    }
	
	public boolean delete(FuJian fuJian) {
        return this.delete(sqlId("delete"),fuJian);
    }

}
